var zfesRoutie={
		zfesRoutieObj:0,
		zfesRoutieRul:"",
		//layerIndex:-1,
		zfesRoutieParamKey:"zfes_routie_param_key",
		zfesRoutieTitleKey:"zfes_routie_title_key",
		setRoutieParam:function(param){
			store.set(zfesRoutie.zfesRoutieParamKey+"_", param);
		},
		getUrlPatam: function(key){
			
			var url=window.document.location.href
			//console.log("getUrlPatam:key ",key," url: ", url);
			var paramStr=url.substring(url.lastIndexOf('#')+1, url.length);
			//console.log("getUrlPatam:param ",paramStr );
			if(paramStr){
				var res= zfesRoutie.parseParam(paramStr,key);
			//	console.log("getUrlPatam:res ",res );
				return res;
			}
			return null;
		},
		getRoutieParam:function(key ){
			//console.log("getRoutieParam:key ",key );
			var param=store.get(zfesRoutie.zfesRoutieParamKey+"_");
			//console.log("getRoutieParam:param ",param );
			if(param){
				var target= zfesRoutie.parseParam(param,key);
				//console.log("getRoutieParam:target ",target );
				return target;
			}
			return null;
		},
		parseParam: function(source,key){
			if(!source||!key){ return null; }
			  var reg = new RegExp("(^|&)" + key + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
	            var r = source.match(reg);  //匹配目标参数
	            if (r != null) {
	            	return unescape(r[2]); 
	            }
	            return null; 
		},
		getRoutieParamString:function(key ){
			var param=store.get(zfesRoutie.zfesRoutieParamKey+"_");
			return param;
		},
		
		setRoutieTitle:function(param){
			store.set(zfesRoutie.zfesRoutieTitleKey+"_", param);
		},
		getRoutieTitle:function(){
			var param=store.get(zfesRoutie.zfesRoutieTitleKey+"_");
			return param;
		},
		
		load: function(url,title,endCallback){
			window.document.location.href="#"+url;
			zfesRoutie.doRoutie(url,title);
		},
		doInitRefresh: function(){
			 var curPath=window.document.location.href;
			 var url = curPath.substring(curPath.indexOf('#')+1, curPath.length);
			 zfesRoutie.doRoutie(url);
		},
		doRoutie: function(url,title){
			routie(url,function(){
				
				if(title){
					zfesRoutie.setRoutieTitle(title);
				}else{
					title=zfesRoutie.getRoutieTitle(title);
				}
				
				var paramStr=url.substring(url.lastIndexOf('#')+1, url.length);
				if(paramStr ){
					zfesRoutie.setRoutieParam(paramStr);
				}
				if(zfesRoutie.zfesRoutieRul==url){
					return;
				}
				loadContent(url);
				$("#zfes_adminlet_main_content_title_big").html(title);
				$("#zfes_adminlet_main_content_title_small").html(title);
				zfesRoutie.zfesRoutieRul= url;
					   
		  });
		}
		
}	 
